/**
 * Sample Skeleton for 'hello-view.fxml' Controller Class
 */

package com.example.demo;

import java.net.URL;
import java.util.Arrays;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;

public class HelloController {

    @FXML // ResourceBundle that was given to the FXMLLoader
    private ResourceBundle resources;

    @FXML // URL location of the FXML file that was given to the FXMLLoader
    private URL location;

    @FXML // fx:id="clickMe"
    private Button clickMe; // Value injected by FXMLLoader

    @FXML // fx:id="welcomeText"
    private Label welcomeText; // Value injected by FXMLLoader

    @FXML
    void ClickMe(ActionEvent event) {
        welcomeText.setText("Hello MF!!!");
    }

    @FXML
    void onHelloButtonClick(ActionEvent event) {
        welcomeText.setText("Wassup nightmare");
        int[] a = {5,5,5,5,4,5};
        int r = a[0];
        boolean res = Arrays.stream(a).allMatch(it -> it == r);
        welcomeText.setText(String.format(""+res));
    }

    @FXML // This method is called by the FXMLLoader when initialization is complete
    void initialize() {
        assert clickMe != null : "fx:id=\"clickMe\" was not injected: check your FXML file 'hello-view.fxml'.";
        assert welcomeText != null : "fx:id=\"welcomeText\" was not injected: check your FXML file 'hello-view.fxml'.";

    }

}
